Component({
  data: {
    selected: 0,
    color: "#000",
    selectedColor: "#1afa29",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "../image/icon_home.png",
      selectedIconPath: "../image/icon_home_HL.png",
      text: "首页"
    }, {
      pagePath: "/pages/graphic/graphic",
      iconPath: "../image/icon_classification.png",
      selectedIconPath: "../image/icon_classification_HL.png",
      text: "分类"
    }, {
      pagePath: "/pages/graphic/graphic",
      iconPath: "../image/icon_graphic.png",
      selectedIconPath: "../image/icon_graphic_HL.png",
      text: "图文"
    }],
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      if (data.index == 1) {
        getApp().globalData.current = 0;
      }
      wx.switchTab({url})
    }
  }
})